-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added article page with apps script as server
- Loading branch information
Showing
4 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Article Display</title> | ||
<link rel="stylesheet" href="./assets/css/articlecss.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> | ||
</head> | ||
<body> | ||
<header> | ||
<h1>My Articles</h1> | ||
</header> | ||
<main> | ||
<div id="articles-container"> | ||
<!-- Articles will be dynamically inserted here --> | ||
</div> | ||
</main> | ||
<script src="./assets/js/article.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# My First Game | ||
|
||
Engine: Godot | ||
Game: Basic something (Endless runner) | ||
Time: 2 days | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
body { | ||
font-family: Arial, sans-serif; | ||
margin: 0; | ||
padding: 0; | ||
background-color: #f4f4f4; | ||
} | ||
|
||
header { | ||
background-color: #333; | ||
color: #fff; | ||
padding: 10px 0; | ||
text-align: center; | ||
} | ||
|
||
main { | ||
padding: 20px; | ||
} | ||
|
||
#articles-container { | ||
background-color: #fff; | ||
padding: 20px; | ||
border-radius: 5px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
async function fetchMarkdown(file) { | ||
// Use the Google Apps Script endpoint | ||
const url = `https://script.google.com/macros/s/AKfycbwJwd_EJdp2aMJwrDFKzcOmdZPXZoVSG3D51Lbu8NCCyR89UBYzCqtfWOazLXNdFLlg/exec?file=${file}`; | ||
const response = await fetch(url); | ||
const markdown = await response.text(); | ||
return markdown; | ||
} | ||
|
||
// Function to render the Markdown content as HTML | ||
async function renderArticle(file) { | ||
const markdown = await fetchMarkdown(file); | ||
if (markdown) { | ||
// Convert Markdown to HTML using the `marked` library | ||
const html = marked.parse(markdown); | ||
// Set the HTML content inside the container | ||
document.getElementById('articles-container').innerHTML = html; | ||
} | ||
} | ||
|
||
// Load a specific article | ||
renderArticle('test.md'); | ||
|
||
|
||
// https://script.google.com/macros/s/AKfycbwgIYWuwBxoHJizYu80uHPTIwQ-yZEaMwT2Y0EXXmxozFixFZLpKvkYN3tbD7-4fLj7/exec |