Created
October 14, 2017 07:08
-
-
Save shravankumar147/4155e24deb9e058e56ef4c9c5533a1b5 to your computer and use it in GitHub Desktop.
jekyll post name generator for github project pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def post_name(name): | |
""" | |
This will generate your github post name. | |
example: | |
post_name('MyBlogpost.md') | |
output: yyyy-mm-dd-MyBlogpost.md | |
""" | |
now = datetime.now().strftime("%Y-%m-%d") | |
return '-'.join([now, name]) | |
print(post_name('MyBlogpost.md')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment