Compare commits
5 commits
c9a945559d
...
ea3d4f3233
Author | SHA1 | Date | |
---|---|---|---|
ea3d4f3233 | |||
930d36efbe | |||
4e4f98d1aa | |||
359a4046ac | |||
a6a118b5bd |
11 changed files with 1911 additions and 3 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +1,8 @@
|
||||||
site/vendor
|
site/vendor
|
||||||
|
site/node_modules
|
||||||
site/_site
|
site/_site
|
||||||
site/.bundle
|
site/.bundle
|
||||||
site/.jekyll-cache
|
site/.jekyll-cache
|
||||||
|
|
||||||
|
# Local Netlify folder
|
||||||
|
site/.netlify
|
||||||
|
|
|
@ -5,8 +5,12 @@ author:
|
||||||
email: dani@00dani.me
|
email: dani@00dani.me
|
||||||
description: "Bootstrap and simple management script for my dotfiles"
|
description: "Bootstrap and simple management script for my dotfiles"
|
||||||
url: 'https://dots.00dani.me'
|
url: 'https://dots.00dani.me'
|
||||||
|
exclude:
|
||||||
|
- netlify.toml
|
||||||
|
- package.json
|
||||||
|
- bun.lockb
|
||||||
|
- node_modules
|
||||||
|
|
||||||
# Build settings
|
|
||||||
theme: minima
|
theme: minima
|
||||||
minima:
|
minima:
|
||||||
skin: auto
|
skin: auto
|
||||||
|
|
9
site/assets/css/code.css
Normal file
9
site/assets/css/code.css
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
pre {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
code {
|
||||||
|
tab-size: 2;
|
||||||
|
}
|
||||||
|
a {
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
1
site/assets/css/monokai.min.css
vendored
Normal file
1
site/assets/css/monokai.min.css
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{background:#272822;color:#ddd}.hljs-keyword,.hljs-literal,.hljs-name,.hljs-selector-tag,.hljs-strong,.hljs-tag{color:#f92672}.hljs-code{color:#66d9ef}.hljs-attribute,.hljs-link,.hljs-regexp,.hljs-symbol{color:#bf79db}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-emphasis,.hljs-section,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-string,.hljs-subst,.hljs-template-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#a6e22e}.hljs-class .hljs-title,.hljs-title.class_{color:#fff}.hljs-comment,.hljs-deletion,.hljs-meta,.hljs-quote{color:#75715e}.hljs-doctag,.hljs-keyword,.hljs-literal,.hljs-section,.hljs-selector-id,.hljs-selector-tag,.hljs-title,.hljs-type{font-weight:700}
|
1840
site/assets/js/highlight.js
Normal file
1840
site/assets/js/highlight.js
Normal file
File diff suppressed because it is too large
Load diff
45
site/assets/js/highlight.ts
Normal file
45
site/assets/js/highlight.ts
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import hljs from 'highlight.js/lib/core';
|
||||||
|
import bash from 'highlight.js/lib/languages/bash';
|
||||||
|
|
||||||
|
hljs.registerLanguage('bash', bash);
|
||||||
|
|
||||||
|
const addStylesheet = function(url: string): void {
|
||||||
|
const link = document.createElement('link');
|
||||||
|
link.rel = 'stylesheet';
|
||||||
|
link.href = url;
|
||||||
|
document.head.appendChild(link);
|
||||||
|
};
|
||||||
|
|
||||||
|
const wrapAsCode = function(container: HTMLElement, language: string): HTMLElement {
|
||||||
|
const code = container.innerHTML.split('\n');
|
||||||
|
code.pop(); // Drop the line that actually runs this script, we don't need it now.
|
||||||
|
|
||||||
|
const codeElement = document.createElement('code');
|
||||||
|
codeElement.className = `language-${language}`;
|
||||||
|
codeElement.innerHTML = code.join('\n');
|
||||||
|
|
||||||
|
const pre = document.createElement('pre');
|
||||||
|
pre.appendChild(codeElement);
|
||||||
|
|
||||||
|
container.replaceChildren(pre);
|
||||||
|
return codeElement;
|
||||||
|
};
|
||||||
|
|
||||||
|
const addReadmeLink = function(codeblock: HTMLElement): void {
|
||||||
|
const span = document.createElement('span');
|
||||||
|
span.className = 'hljs-comment';
|
||||||
|
const readme = document.createElement('a');
|
||||||
|
readme.innerText = 'WHAT IS THIS';
|
||||||
|
readme.href = 'https://dots.00dani.me/README';
|
||||||
|
span.append('# ', readme);
|
||||||
|
|
||||||
|
codeblock.querySelector('span.hljs-meta + span.hljs-comment')?.replaceWith(span);
|
||||||
|
};
|
||||||
|
|
||||||
|
addStylesheet('/assets/css/style.css');
|
||||||
|
addStylesheet('/assets/css/code.css');
|
||||||
|
addStylesheet('/assets/css/monokai.min.css');
|
||||||
|
|
||||||
|
const codeblock = wrapAsCode(document.body, 'bash');
|
||||||
|
hljs.highlightElement(codeblock);
|
||||||
|
addReadmeLink(codeblock);
|
BIN
site/bun.lockb
Executable file
BIN
site/bun.lockb
Executable file
Binary file not shown.
|
@ -1,4 +1,4 @@
|
||||||
---
|
---
|
||||||
---
|
---
|
||||||
{% include_relative local/bin/dots %}
|
{% include_relative local/bin/dots %}
|
||||||
# <link rel="stylesheet" href="/assets/css/style.css"><style>body { display: block; white-space: pre-wrap; font-family: "Menlo", "Inconsolata", "Consolas", "Roboto Mono", "Ubuntu Mono", "Liberation Mono", "Courier New", monospace; margin: 5px; tab-size: 2; } a { font-size: 1.3em; }</style>
|
# <script type="text/javascript" src="{{ '/assets/js/highlight.js' | relativepath }}"></script>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
../local
|
../dot-local
|
4
site/netlify.toml
Normal file
4
site/netlify.toml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
[build]
|
||||||
|
base = "site/"
|
||||||
|
publish = "site/_site/"
|
||||||
|
command = "jekyll build"
|
1
site/package.json
Normal file
1
site/package.json
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{ "dependencies": { "highlight.js": "^11.9.0" } }
|
Loading…
Reference in a new issue