-
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.
CSS in inserted and linked to now when supplied
- Loading branch information
Showing
20 changed files
with
108 additions
and
26 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,3 @@ | ||
nav-link:hover{ | ||
background:aqua | ||
} |
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 |
---|---|---|
|
@@ -4,10 +4,11 @@ | |
<meta property="keywords" content="cats example"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"><div class="container-fluid"> | ||
<nav class="navbar navbar-light bg-light"><div class="container-fluid"> | ||
<a class="navbar-brand me-auto" style="margin-left: 20px" href="/Index.html">My Generated Site</a> | ||
<button | ||
class="navbar-toggler bg-light" | ||
|
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 |
---|---|---|
|
@@ -2,10 +2,11 @@ | |
<html lang="en-nz"><head> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"><div class="container-fluid"> | ||
<nav class="navbar navbar-light bg-light"><div class="container-fluid"> | ||
<a class="navbar-brand me-auto" style="margin-left: 20px" href="/Index.html">My Generated Site</a> | ||
<button | ||
class="navbar-toggler bg-light" | ||
|
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 |
---|---|---|
|
@@ -3,10 +3,11 @@ | |
<title>Behaviour and Intelligence</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"><div class="container-fluid"> | ||
<nav class="navbar navbar-light bg-light"><div class="container-fluid"> | ||
<a class="navbar-brand me-auto" style="margin-left: 20px" href="/Index.html">My Generated Site</a> | ||
<button | ||
class="navbar-toggler bg-light" | ||
|
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 |
---|---|---|
|
@@ -5,10 +5,11 @@ | |
<meta property="thiswill" content="appear in metadata but the title will only appear as <title></title>"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"><div class="container-fluid"> | ||
<nav class="navbar navbar-light bg-light"><div class="container-fluid"> | ||
<a class="navbar-brand me-auto" style="margin-left: 20px" href="/Index.html">My Generated Site</a> | ||
<button | ||
class="navbar-toggler bg-light" | ||
|
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 |
---|---|---|
|
@@ -3,10 +3,11 @@ | |
<title>History</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"><div class="container-fluid"> | ||
<nav class="navbar navbar-light bg-light"><div class="container-fluid"> | ||
<a class="navbar-brand me-auto" style="margin-left: 20px" href="/Index.html">My Generated Site</a> | ||
<button | ||
class="navbar-toggler bg-light" | ||
|
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,3 @@ | ||
nav-link:hover{ | ||
background:aqua | ||
} |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
<title>Site Map</title> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous"> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script> | ||
<link href="/css/additional-style.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<main id="content" class="bd-content order-1 py-5"><div class="container-xxl bd-gutter"> | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
<urlset><url><loc>https://example.com/cat-topics/anatomy.html</loc><lastmod>2022-12-12</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/behaviour.html</loc><lastmod>2022-12-12</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/cat-care.html</loc><lastmod>2022-12-12</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/history.html</loc><lastmod>2022-12-12</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/Index.html</loc><lastmod>2022-12-12</lastmod><priority>1</priority><changefreq>monthly</changefreq></url></urlset> | ||
<urlset><url><loc>https://example.com/cat-topics/anatomy.html</loc><lastmod>2022-12-29</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/behaviour.html</loc><lastmod>2022-12-29</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/cat-care.html</loc><lastmod>2022-12-29</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/cat-topics/history.html</loc><lastmod>2022-12-29</lastmod><priority>1</priority><changefreq>monthly</changefreq></url><url><loc>https://example.com/Index.html</loc><lastmod>2022-12-29</lastmod><priority>1</priority><changefreq>monthly</changefreq></url></urlset> |
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
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
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
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 |
---|---|---|
|
@@ -20,18 +20,18 @@ public HTMLGenerator(SymbolisedDocument doc, Configuration config) | |
this.config = config; | ||
} | ||
|
||
public StringBuilder Generate(Func<string, string> linkRewriter, ICollection<(string url, string title)>? itemsInNavBar = null) | ||
public StringBuilder Generate(Func<string, string> linkRewriter, ICollection<(string url, string title)>? itemsInNavBar = null, IEnumerable<string>? styleURLs=null) | ||
{ | ||
HTML.HtmlDocument htmlDoc = (HtmlDocument)ToHTMLSymbols(doc, doc.Source, linkRewriter); | ||
AddOptionalsToDoc(config, itemsInNavBar, htmlDoc, linkRewriter); | ||
AddOptionalsToDoc(config, itemsInNavBar, htmlDoc, linkRewriter, styleURLs); | ||
|
||
return htmlDoc.Write(new StringBuilder()); | ||
} | ||
|
||
/// <summary> | ||
/// Adds things other than content to the doc, like the navigation bar and styling | ||
/// </summary> | ||
internal static void AddOptionalsToDoc(Configuration config, ICollection<(string url, string title)>? itemsInNavBar, HtmlDocument htmlDoc, Func<string, string> linkRewriter) | ||
internal static void AddOptionalsToDoc(Configuration config, ICollection<(string url, string title)>? itemsInNavBar, HtmlDocument htmlDoc, Func<string, string> linkRewriter, IEnumerable<string>? styleURLs) | ||
{ | ||
if (config.IncludeBootstrap_CSS) | ||
{ | ||
|
@@ -42,6 +42,14 @@ internal static void AddOptionalsToDoc(Configuration config, ICollection<(string | |
htmlDoc.AddToHeader("<script src=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4\" crossorigin=\"anonymous\"></script>"); | ||
} | ||
|
||
if (styleURLs != null) | ||
{ | ||
foreach (string styleSheetURL in styleURLs) | ||
{ | ||
htmlDoc.AddToHeader($"<link href=\"{styleSheetURL}\" rel=\"stylesheet\">"); | ||
} | ||
} | ||
|
||
if (itemsInNavBar != null) | ||
{ | ||
Navbar navbar = new(linkRewriter(config.HomePage)) | ||
|
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
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
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
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
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
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
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