heimfisch / blogtheme
A simple Bootstrap based Blog Theme. Check out the demo page and all available templates https://dev.heinisch-design.de/demo/blogtheme.
Installs: 121
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Hack
Type:automad-package
pkg:composer/heimfisch/blogtheme
Requires
- automad/package-installer: ^1.1 || dev-master
 
README
Caution
This Theme is under development
BlogTheme for Automad
This is a simple Bootstrap based theme with 3 layouts and an optional sidebar. This theme has a light and a dark mode.
Included Templates
This package contains these simplified templates that only serve demonstrational purposes:
- The 
page.phptemplate represents a basic page with a navbar, a content area and a sidebar with menu. - The 
post.phptemplate contains a filterable and sortable pagelist that can be used as a skeleton for blogs or portfolios. - The 
blog.phptemplate demonstrates the usage of session variables and thesetfunction. 
Also included is a navbar with some options
☝️ To see those templates in action while playing around just apply them to any page in your installation!
Dark Light Mode
This template detecte the operation system prefert dark or light mode and use it.
<script>
    (function () {
        const htmlElement = document.querySelector("html")
        if(htmlElement.getAttribute("data-bs-theme") === 'auto') {
        function updateTheme() {
            document.querySelector("html").setAttribute("data-bs-theme",
            window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
        }
            window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', updateTheme)
        updateTheme()
        }
    })();	
</script>
You can disable the feature in the settings.
The Local Package
- 
It's a good practice to start developing a new package outside of the Automad packages directory. Therefore change to some directory outside of Automad where you want to develop your new theme. Let's assume you want to put your package into a directory called
devwithin your home folder.cd ~/dev - 
Create new skeleton theme in your
devdirectory using Composer.composer create-project automad/theme-skeleton my-theme - 
Change to the new theme directory and edit the
composer.jsonandtheme.jsonfiles. VS Code is used here as the editor. At least change the vendor and theme name.cd my-theme code composer.jsonAlso edit the name in
theme.json.code theme.json - 
Now change to your Automad root directory. For example
~/Sites/automad-site.cd ~/Sites/automad-site - 
Edit the
composer.jsonfile of the Automad installation.code composer.jsonAdd the following snippet to Automad's composer file (note the path to your package).
{ ... "repositories": [ { "type": "path", "url": "~/dev/my-theme" } ], ... } - 
Still in the Automad directory run the following Composer command.
composer require my-vendor/my-theme:@devNow your theme is available in Automad and you can start developing your templates. After all the setup it's now time to create a repository for your theme.
 
Create a Git Repository
When developing is done, it's time to publish your work.
- 
Init new Git repository and commit files.
cd ~/dev/my-theme git init git add . git commit -m "First commit" - 
Create a first release tag for your finished theme following the semantic versioning scheme.
git tag -a 1.0.0 -m "my version 1.0.0" - 
Create a new repository on GitHub.
 - 
Now, add its URL as a remote to your local repository and push changes. When creating a repository, the URL will be printed on the GitHub page.
git remote add origin /remote/URL/of/your/new/repo git push -u origin master 
Register Your Package
Now it's time to submit your theme package to Packagist. After succseffuly registering it, it will automatically show up in the package browser.
Cheat Sheets
In case you prefer to start developing a theme or extension without reading the full documention, the Cheat Sheets are a good point to start.