---
title: "Content creation 👷"
date: "2023-07-04T18:30:44+03:00"
author: "anybody"
contributors: ["constantinos-miltiadis.md"] 
draft: false 
keywords:
  - internal
  - journal management 
abstract: |
  (Internal) Guide for creating new content. 
---

# Creating new content 

The optimal way to create new content (a new Markdown file) is via the terminal. To do so open a terminal window and navigate to the root directory of the project. The general command pattern for creating new content is: 
> `hugo new <contentType>/filename.md` 

Where `<contentType>` corresponds to a predefined type and corresponding folder. For this project, these are `article`, `issue`, `contributor`, `editor`, and `print`. 

New content is created following `archetypes` (templates), described below. 
Before creating new content, make sure to follow ![file-naming conventions](article:int-conventions). 

# Archetypes

New content is generated following `archetypes` (see `<rootFolder>/archetypes/`). Archetypes are Markdown files and can be thought of as templates that pertain to specific content types, and dictate what content to be included upon creating a new file. 

Currently, archetypes will be generated with instructions for their creator, in the form of a to-do list. 

The absolutely necessary information required is the TOML header of an entry.  
- `title` (currently inherited from filename)
- `date` (automated date)
- `draft: true`

## Suboptimal way to create new content
Another way to add content is to duplicate an existing MD file. However, this, along with duplicating the content of the original, will also inherit its header metadata, such as date and author. 
# Steps for creating new content 

1. Create new file via the terminal. 
2. Open the new file and edit header information (title, author [file creator], keywords, abstract, etc.)
3. Edit file content.  
4. Commit changes via git when necessary. 
5. When editing is done and the new entry is ready for publishing, change the `draft: true` to `draft: false`. 
6. Commit changes via git, and include the keyword `!publish!` in your commit message, which will recompile the site. 


# Commands and conventions for creating new files 

Please see first the article on ![file-naming conventions](article:int-conventions).  

New issue (x is issue number):

> `hugo new issue/issue-x.md` 

New article (x is issue number): 
> `hugo new article/x-short-title.md`

New contributor: 
> `hugo new contributor/name-surname.md`

New print perspective (this will most likely break the site if the print destination file does not exist -- edit the field `print: "article/some-article.md"` accordingly): 
> `hugo new print/x-p-short-title.md`  

# Parenting content 

*Sandpoints* follows a triadic hierarchy, which, here is *Journal>Issue>Article*, or:     
```
Journal   
 └── Issue     
	└── Article
```

Thus, a journal has issues, and issues have articles. Following the same convention, each item that has children, in its TOML header section has

The journal TOML section has the following field: 
```
has_issues: []
```
And the TOML section of an issue instance has the field: 
```
has_articles: []
```

## Parenting issues to the journal 

```
---
title: "The Journal"
has_issues: ["some-issue.md", "some-other-issue.md"]
---
```

## Parenting articles to issues
```
---
title: "Some issue"
has_articles: ["some-article.md", "some-other-article.md"]
---
```
