Skip to content

Commit

Permalink
Remove need for git command
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Oct 9, 2024
1 parent 532a2e9 commit 40efd0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions docs/src/content/docs/getting-started/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar:
order: 3
---

## Update [[68b130088f5e365ec2a341cae48bc5b353ccc2ff]]
## Update 9/10/2024 [[8de72b2de5a275497c67123904a280981415c553...68b130088f5e365ec2a341cae48bc5b353ccc2ff]]

### Hacktoberfest

Expand Down Expand Up @@ -33,7 +33,7 @@ I am running our own Hacktoberfest! Check out the [Hacktoberfest](/getting-start
- The [[Emberlight]], [[Scorching bow]] and [[Purging staff]] weapons now act as demonbane weapons.
- [[Emberlight]] boosts at all demon mobs, Scorching Bow, Purging Staff and Burning Claws only affect TDs (with the exception of Scorching Bow also being BIS at K'ril)

## Update
## Update 6/10/2024

We now have a new wiki at https://wiki.oldschool.gg/, and the BSO Wiki is now combined together with the OSB wiki. Many pages are out of date, I'm trying to update pages when I have time. Currently, the only way to contribute to the new wiki is by editing files in [this folder on github](https://github.com/oldschoolgg/oldschoolbot/tree/master/docs/src/content/docs).

Expand Down
11 changes: 2 additions & 9 deletions docs/src/plugins/items.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { collapseWhiteSpace } from 'collapse-white-space';
import { visitParents } from 'unist-util-visit-parents';

import { execSync } from 'node:child_process';
import bsoItemsJson from '../../../data/bso_items.json';
import commandsJson from '../../../data/osb.commands.json';
import { Items } from '../../../node_modules/oldschooljs';
Expand All @@ -10,10 +9,6 @@ import { authorsMap } from './authors';

const bsoItems = Object.entries(bsoItemsJson);

function isGitHash(str: string): boolean {
return /^[a-f0-9]{40}$/.test(str);
}

const imageExtensions = ['png', 'jpg', 'jpeg', 'gif', 'webp'];

export function remarkItems(options: any) {
Expand Down Expand Up @@ -66,11 +61,9 @@ export function remarkItems(options: any) {
node.type = 'html';
node.value = node.value.replace(`[[${match}]]`, customHtml);
continue;
} else if (isGitHash(match)) {
const raw = execSync(`git show -s --format=%cI ${match}`, { encoding: 'utf-8' }).trim();
const date = new Date(raw);
} else if (match.includes('...')) {
const test = `<svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="32" height="32" viewBox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"><path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z"></path></svg>`;
const customHtml = `${date.toLocaleDateString()} <a style="display: inline-block;" target="_blank" class="git_hash" href="https://github.com/oldschoolgg/oldschoolbot/compare/${match}">${test}</a>`;
const customHtml = `<a style="display: inline-block;" target="_blank" class="git_hash" href="https://github.com/oldschoolgg/oldschoolbot/compare/${match}">${test}</a>`;
node.type = 'html';
node.value = node.value.replace(`[[${match}]]`, customHtml);
continue;
Expand Down

0 comments on commit 40efd0a

Please sign in to comment.