For any questions please reach out to Atomic, you probably know how.
Fork the repository.
Clone it to your machine.
Make sure you have Node 16.17.0
or similar installed, asa well as npm ^8.0.0
.
You may use nvm to switch node versions.
Run npm install
in the root directory.
Run ng serve --open
to serve a local instance of the website, usually available at http://localhost:4200
.
Run ng g c content/posts/<year>/<name-of-your-post> --module=submodules/app-content-<year>
Rename the newly created folder at content/posts/<year>/<name-of-your-post>
to content/posts/<year>/YYMMDD-<name-of-your-post>
(YYMMDD being the date you have started writing the post).
Update
submodules/app-content-<year>
to reflect this new path if your IDE has not done so automatically.
In the file content/posts/<year>/YYMMDD-<name-of-your-post>/<name-of-your-post>.ts
rename the Component
from <NameOfYourPost>Component
to Mmm<year><NameOfYourPost>Component
(with Mmm being the 3 letter abbreviation for the month the post was written in, e.g. Jan, Feb, Mar, Apr, ...)
Update
submodules/app-content-<year>
to reflect this new component name if your IDE has not done so automatically.
In the file content/posts/<year>/YYMMDD-<name-of-your-post>/<name-of-your-post>.ts
, start with the following base in your Mmm<year><NameOfYourPost>Component
class:
export class Mmm<year><NameOfYourPost>Component implements OnInit {
constructor(private meta: MetaService) { }
/** Set the page metadata information. */
ngOnInit(): void {
this.meta.setTags(`${BASE_URL}/post/YYYY/YYYY_MM_DD+name-of-your-post`, 'Post title',
`${BASE_URL}/assets/images/a-cover-image`, 750, 750,
['a', 'series', 'of tags', 'for your convenience', 'and SEO']);}
}
Don't forget to import
MetaService
fromsrc/app/services/meta.service
andBASE_URL
fromsrc/app/data/url
.
In the file content/posts/<year>/YYMMDD-<name-of-your-post>/<name-of-your-post>.html
, start with the following base:
<app-post [created]="[YYYY, MM, DD]" [edited]="[YYYY, MM, DD]">
<!-- YOUR CONTENT HERE -->
</app-post>
Note: Only required on first contributio
In the file data/authors.ts
, add and complete the following structure to the authors
AuthorMap:
'YourNameOrAlias': {
name: 'Your Name or Alias, and more',
bio: 'A biography',
avatar: '/assets/images/authors/your-image.ext',
links: [
{
label: 'Blog',
icon: 'fas fa-fw fa-globe',
url: 'https://link',
},
...
]
},
If adding an image, please add it to
/assets/images/authors/
.
For more label icons, please see the
authors.ts
file for inspiration or the FontAwesome icon list.
You need only modify this file to have changes replicate accross the website.
In the file routing/app-sub-routes-<year>.ts
, add and complete the following structure to the subroutes<year>
array:
{
path: 'YYYY_MM_DD+name-of-your-post-url',
component: MmmYYYYNameOfYourPostComponent,
data: {
title: 'Your post title',
authors: [ authorList['YourNameOrAlias'] ],
description: 'A description of your post / the topics covered.',
imageUrl: '/assets/images/a-cover-image.ext',
tags: [ TAG_YYYY ],
}
},
Add the URL /post/<year>/YYYY_MM_DD+name-of-your-post-url
to the file at the bottom.
Add the URL /post/<year>/YYYY_MM_DD+name-of-your-post-url
as a string in the ROUTES
array.
Add the following structure as the last element of the <urlset>
array:
<url>
<loc>https://digitaloverdose.tech/post/YYYY/YYYY_MM_DD+name-of-your-post-url</loc>
<priority>0.50</priority>
<changefreq>weekly</changefreq>
</url>
Add the following structure as the last element of the <rss><channel>
element:
<item>
<title>Your post title!</title>
<link>https://digitaloverdose.tech/post/YYYY/YYYY_MM_DD+name-of-your-post-url</link>
<description>Your Post description.</description>
<guid>digitaloverdose/post-YYYY-<next-numerical-index></guid>
<pubDate>ddd, mmm. nth, YYYY</pubDate>
</item>
Run npm run prerender
Navigate to the /dist/digitaloverdose.github.io/browser
directory.
Start a local server.
I like to use Python3:
python3 -m http.server 8000
and access it in a browser at http://localhost:8000
Run the following commands:
git add .
git reset ./dist
git commit -m "A custom commit message"
git push -u origin main
Make sure to configure your user.name and user.email in the local repository config if you wish to limit the information that could be available in a commit message / git log.
git config user.name "NAME <EMAIL>"
git config user.email "EMAIL"
When finished with your contributions, open a pull request on GitHub, and possibly also send Atomic a message.