Skip to content

Commit e9e3f58

Browse files
authored
Merge pull request #552 from santiment/refactor/astro
Refactor/astro
2 parents 6fcf77a + 58c67ce commit e9e3f58

1,291 files changed

Lines changed: 47630 additions & 66929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docs/GUIDE.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# How to write Academy articles
2+
3+
## High-level file structure
4+
5+
![File Structure](./file_structure.png)
6+
7+
All pages seen on the website are located inside `src/content/docs/`.
8+
For example all metrics articles are located inside src/docs/metrics/, pages about
9+
Sanbase are inside `src/docs/guides/sanbase/`, etc.
10+
11+
This structure is very important for the visualization. It should be created inside the most appropriate directory, or if such directory is missing - create a new directory.
12+
13+
## Article-level file structure
14+
15+
When creating a new article, do the following steps:
16+
17+
- Decide on the article title. For the purpose of the example let's choose 'Trading and Transaction Volume'
18+
- Locate the most appropriate directory where the article
19+
- Create a new folder named `trading-and-transaction-volume` inside it. This directory name is important
20+
and should reflect the name of the article itself. Usually it is the `snake-case` version of the title.
21+
This directory name is important as we'll use it when we create links to that article.
22+
- Create an `index.mdx` file inside that directory. The name is important. This will be the main/index page of
23+
the article.
24+
25+
## Contents of the index.mdx file
26+
27+
### Header
28+
29+
Always start with the header structure, which looks like this.
30+
Fields `title` and `datePublished` are mandatory.
31+
`datePublished` field must not be update after article deploy.
32+
Add field `dateModified` and write any changes thee instead.
33+
34+
```
35+
---
36+
title: Trading and Transaction Volume
37+
author: Santiment Team
38+
datePublished: 2025-05-13
39+
---
40+
```
41+
42+
![Header fields](./title_and_date.jpg)
43+
44+
The `title` and `dateModified` fields are displayed on the article page, as seen in the screenshot.
45+
46+
The `title` field will be transformed to an h1 HTML tag in the final page.
47+
One page should have one h1 tag, holding the title. In Markdown this is usually represented
48+
as a line starting with `#`, like:
49+
50+
`# Trading and Transaction Volume`.
51+
52+
As this is done automatically by us by defining the title, we should **not** use `# title` anywhere in the article thereafter.
53+
54+
Do not define the title second time with markdown!
55+
56+
### Youtube Video
57+
58+
If some video from our channel needs to be added, go to the youtube video and copy the `iframe`
59+
that is produced when you click Share->Embed
60+
![noborder](./embed_youtube_video_1.png)
61+
62+
Paste the copied iframe right after the header definition, if you wish to have the video right after the title on the final page.
63+
64+
### Subsections
65+
66+
As our title is defined in the header, all main subsections are defined as:
67+
68+
```
69+
## Title of subsection 1
70+
```
71+
72+
These subsections are shown as h2 titles in the HTML (smaller titles than the main title).
73+
They are also shown in the right sidebar/map of the article.
74+
75+
![noborder](./subsections.png)
76+
77+
You can use `###`, `####`, etc. to further nest subsections.
78+
79+
You should be consistent -- all top-level subsections should be `##` and the subsections of these subsections should
80+
be `###`, and so on.
81+
82+
### Links and images
83+
84+
#### Links
85+
86+
Markdown link syntax is: `[Link Text](Link URL)`. The link URL can be:
87+
88+
- External (link to sanbase) -- the full URL must be provided. Example: `[Sanbase](https://app.santment.net)`
89+
- Internal -- point to some other page of Academy. These paths are relative. Relative paths allow you to link to stage
90+
pages on stage and to prod pages on prod. Do not use full paths when linking to other Academy pages!
91+
92+
Example: `[NVT article](/metrics/nvt)`. The root of the relative path is the `/src/docs/` directory.
93+
94+
Standard relative path syntax works: `./` points to the current directory and `../` points to the parent directory.
95+
96+
The same rules apply to linking from other pages to your new article page.
97+
If our example `Trading and Transaction Volume` article is located in the `Education and Use Cases` directory, then
98+
the following syntax will create a link to our article: `[Trading and Transaction Volume](/education-and-use-cases/trading-and-transaction-volume/)`
99+
100+
#### Images
101+
102+
Markdown image syntax is `![noborder](Image path)`.
103+
104+
In almost all cases the image file is located in the same directory as the `index.md` file. If the image `img.png` is located
105+
in the same directory, then the following syntax will add it `![noborder](./img.png)`. The `./` is the above-mentioned way to point
106+
to the current directory.
107+
108+
Note: The `noborder` is Academy-specific and it removes borders from images. By default we prefer to not have borders.
109+
110+
Prefer adding the images to the directory of your article instead of using images hosted on some other server.

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
svelte-widgets/** linguist-generated=true

.gitignore

Lines changed: 23 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,36 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12-
*.pid.lock
13-
14-
# Directory for instrumented libs generated by jscoverage/JSCover
15-
lib-cov
16-
17-
# Coverage directory used by tools like istanbul
18-
coverage
1+
# build output
2+
dist/
3+
public/
4+
public/pagefind/
195

20-
# nyc test coverage
21-
.nyc_output
6+
# generated types
7+
.astro/
228

23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24-
.grunt
25-
26-
# Bower dependency directory (https://bower.io/)
27-
bower_components
28-
29-
# node-waf configuration
30-
.lock-wscript
31-
32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
33-
build/Release
34-
35-
# Dependency directories
9+
# dependencies
3610
node_modules/
37-
jspm_packages/
38-
39-
# Typescript v1 declaration files
40-
typings/
4111

42-
# Optional npm cache directory
43-
.npm
12+
#svelte
13+
.svelte-kit
4414

45-
# Optional eslint cache
46-
.eslintcache
47-
48-
# Optional REPL history
49-
.node_repl_history
15+
# logs
16+
npm-debug.log*
17+
yarn-debug.log*
18+
yarn-error.log*
19+
pnpm-debug.log*
5020

51-
# Output of 'npm pack'
52-
*.tgz
21+
# static
22+
static/webkit
23+
static/vendors
24+
static/~partytown
5325

54-
# dotenv environment variables file
26+
# environment variables
5527
.env
28+
.env.production
5629

57-
# gatsby files
58-
.cache/
59-
public
60-
61-
# Mac files
30+
# macOS-specific files
6231
.DS_Store
6332

64-
# Yarn
65-
yarn-error.log
66-
package-lock.json
67-
.pnp/
68-
.pnp.js
69-
# Yarn Integrity file
70-
.yarn-integrity
71-
33+
# jetbrains setting folder
7234
.idea/
7335

74-
.tool-versions
75-
.aider*
76-
77-
78-
# web components
79-
80-
svelte-widgets/.svelte-kit
81-
svelte-widgets/static/webkit
82-
83-
# mkcert
84-
85-
local.santiment.net.pem
86-
local.santiment.net-key.pem
36+
mkcert

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
./src/content/docs/**/*.md
2+
./src/content/docs/**/*.mdx

.prettierrc

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,39 @@
11
{
22
"endOfLine": "lf",
33
"semi": false,
4-
"singleQuote": false,
4+
"singleQuote": true,
55
"tabWidth": 2,
6-
"trailingComma": "es5"
6+
"trailingComma": "all",
7+
"plugins": [
8+
"prettier-plugin-astro",
9+
"prettier-plugin-svelte",
10+
"@trivago/prettier-plugin-sort-imports",
11+
"prettier-plugin-tailwindcss"
12+
],
13+
"importOrder": [
14+
"^astro",
15+
"^svelte",
16+
"^san-webkit-next/(.*)$",
17+
"^\\$layouts/(.*)$",
18+
"^\\$components/(.*)$",
19+
"^\\$modules/(.*)$",
20+
"^\\$config/(.*)$",
21+
"^[./]"
22+
],
23+
"importOrderSeparation": true,
24+
"importOrderSortSpecifiers": true,
25+
"overrides": [
26+
{
27+
"files": "*.astro",
28+
"options": {
29+
"parser": "astro"
30+
}
31+
},
32+
{
33+
"files": "*.svelte",
34+
"options": {
35+
"parser": "svelte"
36+
}
37+
}
38+
]
739
}

0 commit comments

Comments
 (0)