Package: victor-ssg
Victor: Static Site GeneratorVictor: Static Site GeneratorInstallFrom sourceFrom TestPyPIUsageInitArchetypesPython Templatingconfig.ymlContentPublicStaticNewBuildServeExample imagesA static site generator for use on myblogThis SSG isrough and unfriendlyand mostly intended just for me.
There are various features this SSG lacks and it can be strict in how a site should be laid out.
I intend to make it more user-friendly in the future, but for now just treat it as a specialised tool.You can read more about the background of this SSG onthis postInstallFrom sourceInstall setuptools and wheelpython3 -m pip install setuptools wheelCreate src directorymkdir $HOME/srccd $HOME/srcClone repogit clone https://github.com/LukeBriggsDev/VictorSSGcd VictorSSGBuild packagepython3 -m buildInstall packagepython3 -m pip install dist/*.tar.gzFrom TestPyPIWith pippython3 -m pip install --extra-index-url https://test.pypi.org/simple/ --index-url https://pypi.org/simple victor-ssgUsageInitcdinto an empty directory and initialisepython3 -m victor initThis will create the following directory structure.
├── archetypes
│   └── default.md
├── config.yaml
├── content
├── public
└── staticArchetypesThis folder contains templates for files created using thenewcommand.
All files are nameddefault.extwhere ext is the extension of the new file.The default archetype is for markdown and looks like this:---
title: ""
date: {{ datetime.now().strftime('%Y-%m-%dT%H:%M:%S') }}
featuredImage: 
author: name
rssFullText: true
categories: []description:---It is a YAML header that includes metadata to draw from when rendering the webpage.title- Title of the page, Appears at the top of a page as a level 1 heading.
Also appears as the title in any list of posts or projects.date- The date of a post or project and determines its order on the pagefeaturedImage- The hero image that appears on the pages that lists posts or projects.
Also appears at the top of any post or project page. Any relative urls are relative to the base_url set inconfig.ymlauthor- The author of the post, used in RSS feedrssFullText- Whether the RSS description should use the whole text or just the descriptiooncategorites- A list of categories the post belongs to, currently unuseddescription- A description of the post or project. Used underneath the title in the projects or posts pages,
If a value is missing then a 280 character excerpt is used insteadOther optionsincludeInSitemap- By default this is true, setting this tofalsewill not include that pag in the sitemap in the built site.Python TemplatingYou can include python in these archetypes that is ran upon file creation by placing it within jinja style braces:{{ python code }}config.ymlThis is a yaml file containing configuration information.
The default config is as follows:{"title":"Title","name":"JohnSmith","subtitle":"ablog","email":"john@example.com","description":"Blogfeed","base_url":"http://example.com/","navbar":[{"name":"Home","url":""},{"name":"Posts","url":"posts"},{"name":"Projects","url":"projects"},{"name":"About","url":"about"}],"index":{"socialLinks":{# Usernames of social platforms"linkedin":"","github":"","gitlab":"","twitter":"","rss":"index.xml",}},}title- Title of website, used within RSS feed, page title and index pagename- Your name, used within RSS feedsubtitle- Subtitle that appears next to main title on index pageemail- Used in RSS feeddescription- Description of RSS feedbase_url-IMPORTANT- URL all relative links will be relative to.
For example if a blog post has a markdown link tomyimage.jpg, this will resolve tohttps://www.example.com/myimage.jpgnavbar- list of page links that will appear in the navigation barname- name of link to appear in nav barurl- url of navigation linksocialLinks- Usernames or links of social sites.
For default sites (LinkedIn, Github, etc) you must use your username for that site.
For added sites you must use a URL.
Any non default sites will look for a fontawesome icon for that site.
For example, adding"facebook"will use thefa-facebookiconContentThe content folder is where markdown files will be created using thenewcommand.Any markdown files in thecontentdirectory will be converted into HTML files.The files' path relative to thecontentdirectory will be their path relative to the base_url on build.Files added to thepostsdirectory will be treated as postsFiles added to theprojectsdirectory will be treated as projectsAny other markdown files will be converted and added topublicat the same path they are tocontentPublicThepublicfolder is the output directory that your static site will be generated into.StaticAny content in the static folder will be copied as-is into the root of the public directoryNewTo create a new postpython3 -m victor new posts/first-post.mdTo create a new project pagepython3 -m victor new projects/first-project.mdTo create any other markdown file to be convertedpython3 -m victor new path/file.mdThere must be at least 1 project and 1 post for the site to buildBuildTo build the page simply runpython3 -m victorYour static site will be generated inpublicServeVictor comes with anincrediblyrudimentary web server:python3 -m victor serveIf you make any changes while the server is running then you will have to close the server, rebuild, then restart the server.Example imagesThere is also an automatic dark theme