Skip to content
Merged

v8.5 #25

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cloudscribe.Syndication.Web/Controllers/RssController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Xml.Linq;

namespace cloudscribe.Syndication.Web.Controllers
{
Expand Down Expand Up @@ -75,6 +77,9 @@ public virtual async Task<IActionResult> Index()

var xml = XmlFormatter.BuildXml(currentChannel);

var processingInstruction = new XProcessingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"/rss-style.xsl\"");
xml.AddFirst(processingInstruction);

return new XmlResult(xml);

}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>
<Target Name="CopyRssAssets" AfterTargets="Build">
<Message Text="Running CopyRssAssets" Importance="High" />
<ItemGroup>
<RssAsset Include="$(MSBuildThisFileDirectory)\rss-style.xsl" />
<RssAsset Include="$(MSBuildThisFileDirectory)\rss.css" />
</ItemGroup>

<Message Text="Checking file: %(RssAsset.Identity)" Importance="High" />

<Copy
SourceFiles="@(RssAsset)"
DestinationFiles="@(RssAsset->'$(ProjectDir)wwwroot\%(Filename)%(Extension)')"
SkipUnchangedFiles="true"
Condition="!Exists('$(ProjectDir)wwwroot\rss-style.xsl') Or !Exists('$(ProjectDir)wwwroot\rss.css')" />
</Target>
</Project>
46 changes: 46 additions & 0 deletions src/cloudscribe.Syndication.Web/buildTransitive/rss-style.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
<xsl:value-of select="/rss/channel/title"/>
</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="/rss.css"/>
</head>
<body>
<header>
<h1>
<xsl:value-of select="/rss/channel/title"/>
</h1>
<p>
<xsl:value-of select="/rss/channel/description"/>
</p>
</header>
<main>
<xsl:for-each select="/rss/channel/item">
<article>
<h3>
<a>
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</a>
</h3>
<p>
<xsl:value-of select="description"/>
</p>
<p>
<xsl:value-of select="pubDate"/>
</p>
</article>
</xsl:for-each>
</main>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
59 changes: 59 additions & 0 deletions src/cloudscribe.Syndication.Web/buildTransitive/rss.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
* {
box-sizing: border-box;
font-family: sans-serif;
line-height: 1.4;
margin: 0;
padding: 0;
}

html {
background: #FFFFFF;
color: #212529;
}

body {
padding: 1.5rem;
}

a {
color: #337ab7;
}

a:hover {
color: #296292;
}

main, header {
margin-block-end: 3rem;
margin-inline: auto;
max-inline-size: 80ch;
}

article {
margin-block-end: 3rem;
}

h1 {
font-size: 2.5rem;
line-height: 1.2;
margin-block: 1rem;
}

h2 {
font-size: 2rem;
margin-block: 2rem;
}

h3 {
font-size: 1.75rem;
margin-block: 1rem;
}

p {
font-size: 1.25rem;
margin-block-end: 1rem;
}

small {
font-size: 1rem;
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Description>asp.netcore mvc controller for rss feeds</Description>
<Version>8.4.0</Version>
<Version>8.5.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>Joe Audette</Authors>
<PackageTags>cloudscribe;syndication;rss;atom;feed</PackageTags>
Expand All @@ -29,6 +29,10 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>



<ItemGroup>
<None Include="buildTransitive\cloudscribe.Syndication.Web.targets" Pack="true" PackagePath="buildTransitive/cloudscribe.Syndication.Web.targets" />
<None Include="buildTransitive\rss-style.xsl" Pack="true" PackagePath="buildTransitive/" />
<None Include="buildTransitive\rss.css" Pack="true" PackagePath="buildTransitive/" />
</ItemGroup>
</Project>
6 changes: 1 addition & 5 deletions src/cloudscribe.Syndication/cloudscribe.Syndication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>cloudscribe.Syndication Class Library</Description>
<Version>8.4.0</Version>
<Version>8.5.0</Version>
<TargetFramework>net8.0</TargetFramework>
<Authors>Joe Audette</Authors>
<PackageTags>cloudscribe;syndication;rss;atom;feed;xml</PackageTags>
Expand All @@ -23,11 +23,7 @@
<None Include="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>


<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>



</Project>
6 changes: 3 additions & 3 deletions update_version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
$directory = "src"

# Define the old & new versions
$oldVersion = '8\.3' # slash needed !
$newVersion = "8.4.0"
$newWildcardVersion = "8.4.*"
$oldVersion = '8\.4' # slash needed !
$newVersion = "8.5.0"
$newWildcardVersion = "8.5.*"


# Get all .csproj files in the directory and subdirectories
Expand Down