Compare commits

..

No commits in common. "c91c09e6062194c41fb9c35e9a959a9f0b3a2138" and "cf7d304474fccae6c89f9486e5f0d7e2eeb92eb4" have entirely different histories.

6 changed files with 5 additions and 75 deletions

View File

@ -19,14 +19,13 @@
# DEALINGS IN THE SOFTWARE.
MARKER = node compile
SITEMAPGEN = node sitemap-gen
BUILD_DIR = ./build
SRC_DIRS = ./docs
MARKDOWN_L = $(patsubst %.md,%.html,$(shell find $(SRC_DIRS) -name "*.md"))
COPY_L = $(patsubst %.css,%.justcopytobuilddir,$(shell find $(SRC_DIRS) -name "*.css"))
all: $(MARKDOWN_L) $(COPY_L) make_sitemap
all: $(MARKDOWN_L) $(COPY_L)
$(MARKDOWN_L): %.html: %.md
$(COPY_L): %.justcopytobuilddir: %.css
@ -39,7 +38,4 @@ $(COPY_L): %.justcopytobuilddir: %.css
%.justcopytobuilddir:
cp -f $< $(BUILD_DIR)
make_sitemap:
$(SITEMAPGEN) $(BUILD_DIR) $(subst $(SRC_DIRS),$(BUILD_DIR),$(MARKDOWN_L))
# end of GNUmakefile

View File

@ -42,10 +42,6 @@ for the `yiki.css` and the `index.html` files.
Example: `gmake VPREFIX:="/yiki/"`
`DOMAIN` Specifiy the domain name that your sitemap.xml links to.
Example `gmake DOMAIN:="example.com"`
## Contributing
I request (but not require) that you modify files without Carriage Returns,

View File

@ -69,9 +69,6 @@ function format(data, name) {
.replace( /* multitag suffix fix for special characters. */
/(<\/(?:a|code)>)\n\t*([.)\];:,])/g,
"$1$2"
).replace( /* fix tag attached to word and not whitespace */
/(\w+)(<[a-zA-Z]\w*>)/g,
"$1 $2"
);
}
// probably should bring in a better templating engine but whatever
@ -81,8 +78,7 @@ function format(data, name) {
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=2.0">
<meta name="description" content="${name} on ${wikiName}">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${name} - Documentation</title>
<link rel="stylesheet" type="text/css" href="${rootPrefix}yiki.css">
</head>

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "yiki",
"version": "0.0.7",
"version": "0.0.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yiki",
"version": "0.0.7",
"version": "0.0.5",
"license": "MIT",
"dependencies": {
"@liquify/prettify": "^0.5.5-beta.1",

View File

@ -1,6 +1,6 @@
{
"name": "yiki",
"version": "0.0.7",
"version": "0.0.5",
"description": "The yellows111 wiki system",
"main": "compile.js",
"scripts": {

View File

@ -1,58 +0,0 @@
// Copyright (c) 2024 yellows111
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// natives
const Process = require("process");
const Filesystem = require("fs");
// required vars
const fileList = Process.argv.slice(3);
const currentDir = Process.argv[2];
var rootPrefix = "/";
if(process.env["VPREFIX"]) {
rootPrefix = process.env["VPREFIX"];
}
rootPrefix = rootPrefix.substring(0, rootPrefix.length - 1);
var targetDomain = "localhost";
if(process.env["DOMAIN"]) {
targetDomain = process.env["DOMAIN"];
}
var outputTemp = "";
function renderSiteMap() {
return ( /* eslint-disable indent */
`<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
${outputTemp}
</urlset>
`
); /* eslint-enable indent */
}
for (let file of fileList) {
outputTemp = outputTemp.concat( /* eslint-disable indent */
` <url>
<loc>https://${targetDomain}${rootPrefix}${file.replace(currentDir, "")}</loc>
<lastmod>${Filesystem.statSync(file).mtime.toISOString().substring(0, 10)}</lastmod>
</url>`
); /* eslint-enable indent */
}
Filesystem.writeFileSync(`${Process.argv[2]}/sitemap.xml`, renderSiteMap());