summaryrefslogtreecommitdiff
path: root/src/web/_views
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2024-09-18 14:14:53 -0400
committerFreya Murphy <freya@freyacat.org>2024-09-18 14:48:54 -0400
commit1f9024763d9224c4cd9a181bac27e6b9f12ad672 (patch)
tree00f827470dad9aa2692483acbdef9502c1a464d3 /src/web/_views
parentfix rss (diff)
downloadwebsite-1f9024763d9224c4cd9a181bac27e6b9f12ad672.tar.gz
website-1f9024763d9224c4cd9a181bac27e6b9f12ad672.tar.bz2
website-1f9024763d9224c4cd9a181bac27e6b9f12ad672.zip
refactor
Diffstat (limited to 'src/web/_views')
-rw-r--r--src/web/_views/apps/blog.php6
-rw-r--r--src/web/_views/apps/blog_post.php2
-rw-r--r--src/web/_views/apps/blog_rss.php5
-rw-r--r--src/web/_views/apps/bucket.php4
-rw-r--r--src/web/_views/comments.php2
-rw-r--r--src/web/_views/footer.php11
-rw-r--r--src/web/_views/head.php22
-rw-r--r--src/web/_views/header.php20
8 files changed, 32 insertions, 40 deletions
diff --git a/src/web/_views/apps/blog.php b/src/web/_views/apps/blog.php
index 7290f0e..f64453c 100644
--- a/src/web/_views/apps/blog.php
+++ b/src/web/_views/apps/blog.php
@@ -1,13 +1,13 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
<?=aria_section('blog', lang('title'))?>
- <p><?=lang('blog_desc', sub: [$this->main->get_url('rss.xml')])?></p>
+ <p><?=lang('blog_desc', sub: [$this->get_url('rss.xml')])?></p>
<?php
foreach($blog as $name => $post) {
$meta = $post['meta'];
- $link = $this->main->get_url('blog/post?name=' . $name);
+ $link = $this->get_url('blog/post/' . substr($name, 0, -3));
echo '<a href="' . $link . '"><h3>' . $meta['name'] . '</h3></a>';
echo '<span>' . $meta['desc'] . '</span><br>';
- echo '<span><time>' . $this->main->format_date($meta['date']) . '</time></span>';
+ echo '<span><time>' . $this->format_date($meta['date']) . '</time></span>';
}
?>
</div>
diff --git a/src/web/_views/apps/blog_post.php b/src/web/_views/apps/blog_post.php
index d5ad255..8b45a62 100644
--- a/src/web/_views/apps/blog_post.php
+++ b/src/web/_views/apps/blog_post.php
@@ -1,6 +1,6 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
<?=aria_section('post', $post['meta']['name'])?>
- <span><?=ucfirst(lang('posted'))?>: <time><?=$this->main->format_date($post['meta']['date'])?></time></span>
+ <span><?=ucfirst(lang('posted'))?>: <time><?=$this->format_date($post['meta']['date'])?></time></span>
<br>
<?=$post['content']?>
</div>
diff --git a/src/web/_views/apps/blog_rss.php b/src/web/_views/apps/blog_rss.php
index c3b1c84..e112389 100644
--- a/src/web/_views/apps/blog_rss.php
+++ b/src/web/_views/apps/blog_rss.php
@@ -7,12 +7,13 @@
<language><?=lang('lang_short')?></language>
<?php
foreach ($blog as $name => $post) {
+ $name = substr($name, 0, -3);
echo '<item>';
echo '<title>' . $post['meta']['name'] . '</title>';
echo '<description>' . $post['meta']['desc'] . '</description>';
echo '<pubDate>' . $post['meta']['date'] . '</pubDate>';
- echo '<link>' . lang('root_url') . 'blog/post?name=' . $name . '</link>';
- echo '<guid>' . lang('root_url') . 'blog/post?name=' . $name . '</guid>';
+ echo '<link>' . lang('root_url') . 'blog/post/' . $name . '</link>';
+ echo '<guid>' . lang('root_url') . 'blog/post/' . $name . '</guid>';
echo '</item>';
}
?>
diff --git a/src/web/_views/apps/bucket.php b/src/web/_views/apps/bucket.php
index 72c349b..aeb6cf3 100644
--- a/src/web/_views/apps/bucket.php
+++ b/src/web/_views/apps/bucket.php
@@ -3,9 +3,9 @@
$root='https://webring.bucketfish.me/redirect.html?to=%s&name=' . $name;
$this->view('head', $data);
if ($lightmode === 'true') {
- echo $this->main->link_css('css/bucket_light.css');
+ echo $this->link_css('css/bucket_light.css');
} else {
- echo $this->main->link_css('css/bucket.css');
+ echo $this->link_css('css/bucket.css');
}
?>
<base target="_parent" />
diff --git a/src/web/_views/comments.php b/src/web/_views/comments.php
index 0544f84..78cc1cb 100644
--- a/src/web/_views/comments.php
+++ b/src/web/_views/comments.php
@@ -3,7 +3,7 @@
<?php
if ($comments)
foreach($comments as $comment) {
- $date = $this->main->format_date($comment['created']);
+ $date = $this->format_date($comment['created']);
echo '<div class="comment">';
echo '<h3 class="header">' . esc($comment['author']) . '</h3>';
diff --git a/src/web/_views/footer.php b/src/web/_views/footer.php
index 1eac625..f451bfd 100644
--- a/src/web/_views/footer.php
+++ b/src/web/_views/footer.php
@@ -6,8 +6,6 @@
} else {
$footer_text = '';
}
-
- $legacy = $this->main->get_ie_version() <= 7;
?>
</div>
</div>
@@ -39,13 +37,12 @@
height="40"
class="bucket"
title="<?=lang('bucket_title')?>"
- src="<?=$this->main->get_url('bucket?name=freya')?>"
+ src="<?=$this->get_url('bucket?name=freya')?>"
></iframe>
</div>
-<?php if($legacy): ?>
- </center>
-<?php else: ?>
</div>
-<?php endif; ?>
+<!--[if lt IE 8 ]>
+ </center>
+<![endif]-->
</body>
</html>
diff --git a/src/web/_views/head.php b/src/web/_views/head.php
index 5534070..27613ff 100644
--- a/src/web/_views/head.php
+++ b/src/web/_views/head.php
@@ -12,18 +12,18 @@
<meta property="og:description" content="<?=$desc?>">
<meta property="og:title" content="<?=$title?>">
<meta property="og:site_name" content="<?=lang('domain')?>">
- <meta property="og:image" content="<?=$this->main->get_url_full('public/icons/logo640.png', TRUE)?>">
+ <meta property="og:image" content="<?=$this->get_url('public/icons/logo640.png', TRUE)?>">
<title><?=$title?></title>
- <link rel="icon" type="image/png" sizes="16x16" href="<?=$this->main->get_url("public/icons/logo16.png", TRUE)?>">
- <link rel="icon" type="image/png" sizes="32x32" href="<?=$this->main->get_url("public/icons/logo32.png", TRUE)?>">
- <link rel="icon" type="image/png" sizes="64x64" href="<?=$this->main->get_url("public/icons/logo64.png", TRUE)?>">
- <link rel="icon" type="image/png" sizes="320x320" href="<?=$this->main->get_url("public/icons/logo320.png", TRUE)?>">
- <link rel="icon" type="image/png" sizes="512x512" href="<?=$this->main->get_url("public/icons/logo512.png", TRUE)?>">
- <link rel="icon" type="image/png" sizes="640x640" href="<?=$this->main->get_url("public/icons/logo640.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="16x16" href="<?=$this->get_url("public/icons/logo16.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="32x32" href="<?=$this->get_url("public/icons/logo32.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="64x64" href="<?=$this->get_url("public/icons/logo64.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="320x320" href="<?=$this->get_url("public/icons/logo320.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="512x512" href="<?=$this->get_url("public/icons/logo512.png", TRUE)?>">
+ <link rel="icon" type="image/png" sizes="640x640" href="<?=$this->get_url("public/icons/logo640.png", TRUE)?>">
<link rel="manifest" href="/manifest.json">
- <?php if($this->main->get_ie_version() <= 7)
- echo $this->main->link_css('css/legacy.css');
- ?>
+ <!--[if lt IE 8 ]>
+ <?=$this->link_css('css/legacy.css')?>
+ <![endif]-->
<?php foreach($css as $file)
- echo $this->main->embed_css($file);
+ echo $this->embed_css($file);
?>
diff --git a/src/web/_views/header.php b/src/web/_views/header.php
index b037038..07c26b8 100644
--- a/src/web/_views/header.php
+++ b/src/web/_views/header.php
@@ -1,16 +1,14 @@
<?php /* Copyright (c) 2024 Freya Murphy */ ?>
<?php
$this->view('head', $data);
- echo $this->main->link_css('css/main.css');
- $legacy = $this->main->get_ie_version() <= 7;
+ echo $this->link_css('css/main.css');
?>
</head>
<body>
-<?php if($legacy): ?>
-<center>
-<?php else: ?>
+<!--[if lt IE 8 ]>
+ <center>
+<![endif]-->
<div class="center">
-<?php endif; ?>
<div id="header" role="banner" aria-label="banner">
<?=image('img/headerLogo', 'alt_website_logo', size: '200')?>
<div class="content">
@@ -20,24 +18,20 @@
<div role="navigation">
<ul id="nav">
<li><?=ilang('action_home',
- href: $this->main->get_url('home'),
+ href: $this->get_url('home'),
container: 'h2'
)?></li>
<li><?=ilang('action_projects',
- href: $this->main->get_url('projects'),
+ href: $this->get_url('projects'),
container: 'h2'
)?></li>
<li><?=ilang('action_blog',
- href: $this->main->get_url('blog'),
+ href: $this->get_url('blog'),
container: 'h2'
)?></li>
</ul>
</div>
</div>
</div>
-<?php if($legacy): ?>
- <div id="main" class="legacy" role="main">
-<?php else: ?>
<div id="main" role="main" aria-label="main">
-<?php endif; ?>
<div id="container">