diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-06-14 07:45:14 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-06-14 07:45:14 +0300 |
commit | a5bf29c00b85358f5cc078422871aa6654866d0c (patch) | |
tree | 177c69399bb1b1ae680265f5c0dedbdbf8305587 /Services | |
parent | afdaabce8fb24f6fd46e387445c076f67a0c98ed (diff) |
Add robots.txt generator
Diffstat (limited to 'Services')
-rw-r--r-- | Services/IRobotsTxtGenerator.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Services/IRobotsTxtGenerator.cs b/Services/IRobotsTxtGenerator.cs new file mode 100644 index 0000000..a238a8e --- /dev/null +++ b/Services/IRobotsTxtGenerator.cs @@ -0,0 +1,21 @@ +using System.Text; + +namespace MyDarling.Controllers; + +public interface IRobotsTxtGenerator +{ + public string GetRobotsText(); +} + +public class RobotsTxtGenerator : IRobotsTxtGenerator +{ + public string GetRobotsText() + { + StringBuilder stringBuilder = new(); + stringBuilder.AppendLine("user-agent: *"); + stringBuilder.AppendLine("disallow: /freedom"); + stringBuilder.AppendLine("disallow: /Account/"); + + return stringBuilder.ToString(); + } +} |